﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DanhmucThietbi;
using DevExpress.XtraGrid.Columns;
using DevExpress.XtraEditors;
using DevExpress.XtraGrid.Views.Grid;

namespace DanhmucThietbi
{
    public partial class frmSubLinhKien : Form
    {
        ThietBiInfo ObjSubLinhKien = new ThietBiInfo();
        CtrThietBi Ctr = new CtrThietBi();
        public DataTable DSSubLinhKien = new DataTable();
        public DataTable DsLK = new DataTable();
        public frmSubLinhKien()
        {
            InitializeComponent();
            DsLK = Ctr.GetLK();
            DsLK.Columns.Add("Select", System.Type.GetType("System.Boolean"));
            foreach (DataRow item in DsLK.Rows)
            {
                item["Select"] = false;
            }
            this.gridControl1.DataSource = DsLK;
        }

        private void btnThoat_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnCapnhat_Click(object sender, EventArgs e)
        {
            foreach (DataRow Rows in DsLK.Rows)
            {
                if (gridView1.Columns["Select"].ToString() == "true")
                {
                    DSSubLinhKien.Rows.Add(Rows);
                }
            }
            this.gridControl1.DataSource = DSSubLinhKien;
        }
    }
}
